//
//  JXHomeDescView.m
//  JXAddressApp
//
//  Created by zhhw_home on 2018/11/4.
//  Copyright © 2018年 zhhw_home. All rights reserved.
//

#import "JXHomeDescView.h"
#import "QMUIButton.h"
#import "QMUICommonDefines.h"
#import "UIColor+QMUI.h"
#import "UIView+QMUI.h"

@interface JXHomeDescView ()

@end

@implementation JXHomeDescView

- (instancetype)initWithFrame:(CGRect)frame
{
    CGFloat width = (SCREEN_WIDTH-50)/4.f;
    frame.size.height = width+40;
    
    if (self = [super initWithFrame:frame]) {
        [self initRootView];
    }
    
    return self;
}

- (void)initRootView
{
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH, 20)];
    titleLabel.text = @"简介";
    titleLabel.textColor = [UIColor qmui_colorWithHexString:@"#333333"];
    titleLabel.font = [UIFont systemFontOfSize:14];
    titleLabel.textAlignment = NSTextAlignmentLeft;
    [self addSubview:titleLabel];
    
    _textView = [[UITextView alloc] initWithFrame:CGRectMake(10, 20, SCREEN_WIDTH-20, 40)];
    _textView.textColor = [UIColor qmui_colorWithHexString:@"#666666"];
    _textView.font = [UIFont systemFontOfSize:14];
    [self addSubview:_textView];
}

- (CGFloat)getHeight
{
    CGSize size = [_textView sizeThatFits:CGSizeMake(SCREEN_WIDTH-20, CGFLOAT_MAX)];
    _textView.qmui_height = size.height + 10;
    
    return size.height+10;
}


@end
